﻿<Window x:Class="GraphViewerWpf.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:graphsharp="clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls"
        xmlns:local="clr-namespace:GraphViewerWpf.Graph"
        xmlns:zoom="clr-namespace:WPFExtensions.Controls;assembly=WPFExtensions"        
        Title="Visualizador de Processos" Height="350" Width="525">
    <Window.Resources>
        <DataTemplate x:Key="template" DataType="{x:Type local:Vertex}">
            <StackPanel Orientation="Horizontal" Margin="5">
                <!--<Image x:Name="img" Source="../Images/boy.ico" Width="20" Height="20" />-->
                <TextBlock Text="{Binding Path=Id, Mode=OneWay}" Foreground="White" />
                <StackPanel.ContextMenu>
                    <ContextMenu>
                        <ContextMenu.ItemsSource>
                            <CompositeCollection>
                                <MenuItem Header="Standard MenuItem 1" />
                                <MenuItem Header="Standard MenuItem 2" />
                                <MenuItem Header="Standard MenuItem 3" />
                            </CompositeCollection>
                        </ContextMenu.ItemsSource>
                    </ContextMenu>
                </StackPanel.ContextMenu>
            </StackPanel>
            <!--<DataTemplate.Triggers>
                <DataTrigger Binding="{Binding IsMale}" Value="false">
                    <Setter TargetName="img" Property="Source"
                                Value="../Images/girl.ico" />
                </DataTrigger>
            </DataTemplate.Triggers>-->
        </DataTemplate>
        <!--<Style TargetType="{x:Type graphsharp:VertexControl}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type graphsharp:VertexControl}">
                        <Border BorderBrush="White" 
                                    Background="Black"
							        BorderThickness="2"
							        CornerRadius="10,10,10,10"
							        Padding="{TemplateBinding Padding}">
                            <StackPanel Orientation="Vertical">
                                
                                <Expander IsExpanded="True">
                                    <ContentPresenter Content="{TemplateBinding Vertex}" 
                                            ContentTemplate="{StaticResource demoTemplate}"/>
                                </Expander>
                                <Expander IsExpanded="True">
                                    <ContentPresenter Content="{TemplateBinding Vertex}" 
                                            ContentTemplate="{StaticResource demoTemplate}"/>
                                </Expander>
                                <Expander IsExpanded="True">
                                    <ContentPresenter Content="{TemplateBinding Vertex}" 
                                            ContentTemplate="{StaticResource demoTemplate}"/>
                                </Expander>
                                <Expander IsExpanded="True">
                                    <ContentPresenter Content="{TemplateBinding Vertex}" 
                                            ContentTemplate="{StaticResource demoTemplate}"/>
                                </Expander>
                            </StackPanel>
                            <Border.Effect>
                                <DropShadowEffect BlurRadius="2" Color="LightGray" 
                                    Opacity="0.3" Direction="315"/>
                            </Border.Effect>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>-->
       <Style TargetType="{x:Type graphsharp:EdgeControl}">
            <Style.Resources>
                <ToolTip x:Key="ToolTipContent">
                    <StackPanel>
                        <TextBlock FontWeight="Bold" Text="Edge Information"/>
                        <TextBlock Text="{Binding Id}"/>
                    </StackPanel>
                </ToolTip>
            </Style.Resources>
            <Setter Property="ToolTip" Value="{StaticResource ToolTipContent}"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Vertical" Grid.Row="0" >
            <StackPanel Orientation="Horizontal" Background="Black" HorizontalAlignment="Stretch" Margin="0">
                <Label VerticalAlignment="Center" VerticalContentAlignment="Center" Foreground="White" FontSize="10" FontFamily="Verdana" FontWeight="Bold" Margin="0,0,0,0" Content="Pick Layout Type"/>
                <ComboBox ItemsSource="{Binding LayoutAlgorithmTypes}" SelectedItem="{Binding Path=LayoutAlgorithmType, Mode=TwoWay}" Width="150" Height="25" Margin="5" />
                <Button Content="Create New Graph" Width="150" Height="25" Margin="5" Click="Button_Click"/>
            </StackPanel>
        </StackPanel>
        <zoom:ZoomControl  Grid.Row="1"  Zoom="0.2" ZoomBoxOpacity="0.5" Background="#ff656565">
            <local:GraphLayout x:Name="graphLayout" Margin="10" Graph="{Binding Path=Graph}" LayoutAlgorithmType="{Binding Path=LayoutAlgorithmType, Mode=OneWay}" OverlapRemovalAlgorithmType="FSA" HighlightAlgorithmType="Simple" />
        </zoom:ZoomControl>
    </Grid>
</Window>
